<!--
- File:    代下单.
-->
<template>
  <div class="Web_Box">
    <div class="pertopimg"><img src="../../assets/images/ban.png"></div>
    <div class="EditReceiptAddress">
      <ul>

        <li class="sli">
          <div class="lefticon"><i class="iconfont icon-tel"></i></div>
          <div class="fl w550">
            <input type="tel" class="inp" placeholder="填写手机号码" v-model="mobile">
          </div>
        </li>
        <li class="sli" style="height:5rem;">
          <div class="lefticon"><i class="iconfont icon-news"></i></div>
          <div class="textarea">
            <textarea placeholder="填写备注信息" v-model="remark"></textarea>
          </div>
        </li>
      </ul>
    </div>
    <div class="">
      <button class=" btns" @click="addAgentOrder">提交</button>
    </div>
  </div>
</template>

<script>
  export default{
    data() {
      return {
        mobile: '',
        remark: ''
      }
    },
    components: {},
    methods: {
      addAgentOrder() {
        if (this.mobile == '') {
          this.$toast('请填写手机号')
          return
        }
        if (this.remark == '') {
          this.$toast('请填写备注信息')
          return
        }
        this.$request.addAgentOrder(this.mobile, this.remark).then(data => {
          this.$toast('提交成功')
          this.$router.go(-1)
        }).catch(e => {
          this.$toast('申请代下单失败:' + e.msg)
        })
      }
    }
  }
</script>

<style>

</style>